#include <bits/stdc++.h>
// 2025/04/05
// tag:
// Author: Forever
using namespace std;
using int64 = int64_t;
#define int long long
#define DIS(a, b) (sqrt((x[a] - x[b]) * (x[a] - x[b]) + (y[a] - y[b]) * (y[a] - y[b])))

int n, m, cnt, x[5001], y[5001];
double ans, dis[5001];
bool vis[5001];

class edge {
public:
    int v;
    double w;
    edge(int v, double w)
        : v(v)
        , w(w) { };
    edge()
        : v(0)
        , w(0) { };
    bool operator<(const edge& e) const
    {
        return w > e.w;
    }
};

priority_queue<edge> q;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> x[i] >> y[i];
    for (int i = 1; i <= n; i++)
        dis[i] = 1e15;
    dis[1] = 0;
    q.emplace(1, 0);
    while (!q.empty()) {
        if (cnt == n)
            break;
        int u = q.top().v;
        double w = q.top().w;
        q.pop();
        if (vis[u])
            continue;
        vis[u] = true;
        cnt++;
        ans += w;
        for (int i = 1; i <= n; i++)
            if (dis[i] > DIS(u, i))
                dis[i] = DIS(u, i), q.emplace(i, dis[i]);
    }
    cout << fixed << setprecision(2) << ans << endl;
    return 0;
}